import request from '@/utils/request'

// 工单列表查询
export function listWorkOrder(params) {
    return request({
        url: '/front/flat/workOrder/workOrder/list',
        method: 'get',
        params: params
    })
}

// 获取工单详细信息
export function getWorkOrderDetail(id) {
    return request({
        url: '/front/flat/workOrder/workOrder/' + id,
        method: 'get',
    })
}

// 新增工单
export function addWorkOrder(data) {
    return request({
        url: '/front/flat/workOrder/workOrder',
        method: 'post',
        data: data
    })
}

// 编辑工单
export function editWorkOrder(data) {
    return request({
        url: '/front/flat/workOrder/workOrder',
        method: 'put',
        data: data
    })
}

// 删除工单
export function deleteWorkOrder(id) {
    return request({
        url: '/front/flat/workOrder/workOrder/' + id,
        method: 'delete'
    })
}

// 评价工单
export function evaluateWorkOrder(data) {
    return request({
        url: '/front/flat/workOrder/evaluate',
        method: 'post',
        data: data
    })
}

// 取消预约
export function cancelAppointment(data) {
    return request({
        url: '/front/flat/workOrder/workOrder/reject',
        method: 'put',
        data: data
    })
}

//工单支付{工单id}
export function unifiedPay(id,type) {
    return request({
        url: '/front/flat/workOrder/workOrder/unifiedPay/' + id+'/'+type,
        method: 'GET'
    })
}

// 跟进记录列表
export function followRecordList(params) {
    return request({
        url: '/front/flat/workOrder/workOrder/record/list',
        method: 'get',
        params: params
    })
}

// 查询该企业全部维修项目信息
export function getMaintenanceItemInfo(params) {
    return request({
        url: '/front/flat/maintenance/item/Info',
        method: 'get',
        params: params
    })
}

// 查询该企业下全部工单人员信息
export function getMaintenanceWorkerInfo(params) {
    return request({
        url: '/front/flat/workOrder/person/info',
        method: 'get',
        params: params
    })
}

// 获取工单详细信息
export function getWorkOrderCountPayState(params) {
    return request({
        url: '/front/flat/workOrder/workOrder/countPayState',
        method: 'get',
        params: params
    })
}

